﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyWeb.Extensions.ServiceExtensions.Filter;
using MyWeb.Extensions.ServiceExtensions.Swagger;
using static MyWeb.Extensions.ServiceExtensions.Swagger.CustomApiVersion;

namespace MyWeb.Api.Controllers.V2
{
    /// <summary>
    /// 测试控制器 V2版本
    /// </summary>
    //[Route("api/[controller]/[action]")]
    [ApiController]
    
    public class TestController : ControllerBase
    {
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [CustomRoute(ApiVersions.V2, "GetTest1")]
        [AllowAnonymous]
        [FixedToken]
        public ActionResult V1_Get1()
        {
            return Ok("V2_Get1");
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [ApiExplorerSettings(GroupName = "V2")]
        [Route("/api/v2/[controller]/[action]")]
        public ActionResult V1_Get2()
        {
            return Ok("V2_Get2");
        }
    }
}
